import Mock from 'mockjs'

export default [
    //权限
    {
        url: '/api/system/permission',
        method: 'get',
        response: ({ query }) => {
            let page = query.page || 1
            let level = query.level || 'A'
            return {
                code: 200,
                msg: 'sucess',
                data: {
                    total: 20,
                    ...Mock.mock({
                        'syspermission|10': [
                            {

                                'sysid|1': ['@increment(1)'],
                                'systemname|1': '@cname',
                                'systemdepart|1': '@ctitle',
                                'systemlevel|1': ['sss', 'ss', 'a', 'b', 'c'],
                                'systemstate|1': '@boolean',


                            }],
                    })

                }
            }
        }
    },

    //编辑提交
    {
        url: '/api/customer/system/edit',
        method: 'post',
        response: () => {
            return {
                code: 200,
                msg: 'sucess',
                data: "编辑成功"
            }
        }
    },


    //编辑提交
    {
        url: '/api/system/permission/edit',
        method: 'get',
        response: ({ query }) => {
            let level = query.level || 'A'
            return {
                code: 200,
                msg: 'success',
                data: {
                    'cities|5': ['@increment(1)'],
                    'schools|10': ['@increment(1)'],
                    'positions|20': ['@increment(1)']
                }
            }
        }
    },

    //保存
    {
        url: '/api/customer/system/save',
        method: 'post',
        response: () => {
            return {
                code: 200,
                msg: 'sucess',
                data: "保存成功"
            }
        }
    },
    // 日志 
    {
        url: '/api/system/log',
        method: 'get',
        response: ({ query }) => {
            let page = query.page || 1
            return {
                code: 200,
                msg: 'sucess',
                data: {
                    total: 20,
                    ...Mock.mock({
                        'syspermission|10': [
                            {
                                'logoperate|1': ['login', 'logout'],
                                'logIp': '@ip',
                                'logFunction': '@word(5)',
                                'logdata': "@date('yyyy-MM-dd')",


                            }],
                    })

                }
            }
        }
    },
    // log编辑
    {
        url: '/api/customer/system/logedit',
        method: 'get',
        response: ({ query }) => {
            return {
                code: 200,
                msg: 'sucess',
                data: {
                    ...Mock.mock({
                        'syspermission|1': [
                            {
                                'logoperate|1': ['login', 'logout'],
                                'logIp': '@ip',
                                'logFunction': '@word(5)',
                                'logdata': "@date('yyyy-MM-dd')",
                            }],
                    })

                }
            }
        }
    },








    

]